Minor fixes to possibleMoves function