B-gap problem is solved by extending the chain with a couple of links.
I have the 10-51 cassette on the XL frame and the 10-45 on the L frame. The 10-45 b-gap is perfectly aligned but with the 10-51 there is still some space left although the screw is fully loosened. Shifting goes faster on the 10-45, so I would advice that for future builds.