ensure proper variables are returned from CDR function (bug #4521)