Trying to fix an ng-repeat bug and removed global vars.: