Fixed move handling and started writing unit tests