Fixing several mistakes in the python wrappers