Fixed syntax and ensured that rook's canCastle and pawn's hasmoved
reflect the state of the piece.