Limit the tries to get a good generated password to 5 and fix the tolerance expression