Fixed undo_last_move method