#117: add trailing slash for paths ending with a directory