Added ability to load files from directories if the pattern ends with a path separator