Fixed improper register values
Added checks to setPulseWidth()