Bug fix in GetValidMoves and convert some arrays to immutable tuples