Isn't numProblems === errors?  If so, then I think this will always be true since there's a !errors early-exit above.