more clean up to shell scripts, fixes to python script