flakes and fix tests