Added Method to get Last Folder

Added a getLastFolder method to get the lowermost folder in the path.
Minor tweak

Some debugging cruft