Fixed some test flakiness.