Fix off by one error in lookup results iteration