Added debug output function, made reachedFailureLimits() test public