Fix ensure_dir: check that path is actually a directory path
Comment on ensure_dir function
Merge pull request #887 from b3b/develop

Fix ensure_dir: check that path is actually a directory path