More flexible PWM
Various updates