Fixed issues in path resolution caused by differences in
path resolution of folders and non-folders.