Fix PWM bug