Fix macro for computing scale factors