Cleanups in mechanism.
Added some failing tests.