Prevent impossible moves to the left or right.