This is a kind of follow-up to e88baee8 which should finally fix the issue which that commit was supposed to fix.