Fix error with PWM period