Make unit tests more stable