Some fixes, seems to be working now in python.