Added validation function for movement controls.