fix bug in memcmp() where the return value is not the difference
various bug fixes before debugging mover logic