Cleanup of motion limiting code, see #15.