fix more bugs in py bindings