Fix tests so that they pass on PyPy