Character controller collision edge cases

Im trying to implement a basic 3d character controller. The way i currently do collision is; i check wether or not the character is inside any geometry before movement. If this is the case, i find the closest point of this geometry, and subtract the vector from the character to the point from the characters velocity. This works for some surfaces, but of course has a lot of issues. There are two that i am trying to figure out right now.

  1. If the character moves into a wall and the floor at the same time, it will be moved out in two frames, because they are seperate objects. One way to fix this is to do the check two times, but this amount increases by one for every object the character moves into, and i do not know the amount beforehand.

  2. If the character moves into a v shape, it will bounce back and forth between the two side each frame, because the collision detection moves it into the other side.

Does anyone know how these are commonly handeled?