Fix broken tests on 3.x