Corrected the pwm disable issue which caused the pwm counter not reset after reenabling.