Fixing intermittent test failures