fixed possible overflow in linear scaling, ref #40