Make the jenkins scripts more robust