update pwm and other minor fixes