Fixes for python, not quite working yet