Fix hashing and fen generation.