Fixed bug in scale factor calculation for div operator