[Redmine #3905] Safe open fixes

https://cfengine.com/dev/issues/3905