Fixed some bugs with the movement.