Fixed the bug with gravity and collision with the ground.