Fixed bugs dealing with double signals and linear scaling; added checks for scenarios where min==max; fixed passing of min and max arguments in test program.