Improved handling of relative paths

Improved handling of relative paths