I think this is fixed in Labs, so I just need to dedicate some spare time to find and backport the relevant patch.