Improved the algorithm to decide the scale to use with div when the argument  is null