Fixed way of computing the scale factor.

Belongs to #66.