Bayern Munich beat RB Leipzig 4-1, but didn't have it all their own way despite what the scoreline suggested.