Added optional exponent argument to misc.scale function