Concurrency fix and cleanup