Merged in latest v1.65 and minor refactor in dcommon.scm