This would be a great change to have in master too, since it is more robust than what we had. But we can do that later (we should also put wrapping this file in an anonymous closure).