handle case when a file has no extension

[fixes #388]
Merge pull request #389 from jenius/sjs/handle-no-extension

handle case when a file has no extension