Fix unit tests randomly failing.