Improved the Zobrist hashing to prevent rehashing in all cases