Added failure counter and fixed management tracking.