Fix bugs in valid_move?