Make get_my_path() safer

Adds maxLen parameter to get_my_path().
Some small cosmetic fixes.
6 files changed