Fix two tests that sometimes were failing