Fix a fatal error when generating from a directory

Fixes #73
Merge pull request #74 from JDGrimes/issue-73

Fix a fatal error when generating from a directory