Made compatible with v3.6; work towards issue #1