Fixes randomly failing tests

Fixes randomly failing tests