Enhancements and fixes for pypi compatibility