Merge Gary's bishop_pin patch