Merge pull request #6 from tessus/master

fixed trailing slash problem with -d and added another case for the output