Fixed castling bugs