fix PyType creation when name is a bytes object, minor cleanups