Small changes to make python script work more often.