Fix bash condition and reloading on python 3.x