castling: fix two bugs
test: add a pgn batch test