Tests determinism

A lot of tests randomly fail due to some ms lost or gain here or there. This PR should fix at least some of them. 

There are probably more, but I can't reproduce any right now.