Bug fix where nth function didnt iterate

This patch fixes a bug where the nth function wasn't iterating properly. The assert.second test was passing because the function passed to do the assertion was never called.