Fix off by one bug in number of attempts