fixes a bunch of python issues