Fix test failures with pypy