Move PWMConfig out of local context. Fixed PWM crashing.