Bug in edge case in move function.