Removed potential race condition found by Damiano.

But still wondering if this is really OK....