Reflect (yet to be merged) changes from https://github.com/cfengine/core/pull/436