Fixed a race condition in Hub tests that caused tests to fail on slow
machines. Fixes #611.