Fix for JSHint not liking promises in loops.