handle case when a file has no extension

fixes #388 

![](http://dogesay.com/wow/such///pr?image=moon)