Better relative path logic