Fix regression from ff28b2438967d82aaf3efdc1433ca7d41104f73f

@simonster could you comment on what exactly d3a69be9970035befda4547c06ea48804f138129 was fixing? I'm having a hard time finding any sort of release note or bug report relating to this fix and I can't really trigger an error after removing it.