handle relative_path_from failures + refactor
Merge pull request #638 from guard/handle_relpath_failure

handle relative_path_from failures + refactor