fix div zeros when scaling