Fix bug when path provided as a string, not pathname

Fixes #24