In issue 1, in the third code snippet within the for loop. Shouldn't this code:
finalParams[key] = defaultParams[key];
be written as finalParams[key] = paramObject[key];