Fixing a race condition, hopefully.