Get rid of the "or null" stuff. Also change 'cfg . "foo"' to 'cfg.foo'. Also fixed what appears to be an actual bug: in postStartScript, cfg.attribute (where attribute is a function argument) should be cfg.${attribute}.