Fix a bug in the player's movement