Improvements to the FEN validation logic.