some fixes for CPython