Fix failing tests on 3.x