removed some regressions from the Python loading logic introduced by the previous modifcations