Minor cleanup
Close activation race condition for multi-threaded apps.