Fixed several issues with the python prototype