fixes to motion-layout, with tests