Fix bugs with move counters.
Add tests for move counters.