Fixes #127. Fixes concurrency issues in several unit tests.