Fixing issues with application using BASEPATH

Fixes #217
Merge pull request #218 from TheSerapher/issue-217

Fixing issues with application using BASEPATH