BUG Better checking of existing files
[ref: CWPBUG-158]
Merge pull request #3101 from tractorcow/pulls/3.1-fileexists-checking

BUG Better checking of existing files