Fixed logic bug in MemMove implementation

Fixes issue #23 and issue #58