Added test for race condition in #153