Fixed bug in getApplicablePath and added error checking
Improved getPath to accept paths with mising trailing slash