Merge pull request #295 from mhils/fix_test_race_condition

fix race condition in tests