Replaced path.basename with path.dirname to fix issue #3.
Merge pull request #4 from OverZealous/master

Replaced path.basename with path.dirname to fix issue #3.