Fix the python bindings to work with modules etc.