Fix pinMode() exception when pin set to PWM.