Some fixes for subdirectory support.
Merge pull request #107 from tobiastom/subdirectory-fixes

Some fixes for subdirectory support.