Quite a few minor errors fixed.  Wasn't looping through routes properly