Added upper and lower limits to PWM.