Cosmetics, fixing a potential race condition