Some performance improvements for PyPy