Handle absolute/relative path correctly