Fixed Castling by restoring some old code.