PWM glitch fix

Provided by ks156 (Paul Rathgeb)