- Added a check for avoiding 0 as a scaling factor.