Avoid passing the dir as a file type

Fix for #3.