fix bug in move, returning wrong n on move fail