minor changes to CheckMovementLimits method.