Resolves concurrency issue described in #25.