fixes for python being magically insane and reloading modules randomly and wiping out global variables