Fix off-by-one bug

If you pass tries=1, the existing code would run your function zero times.