Fix a minor bug in checkMovement method