Avoid crashing if a short relpath is returned
Correctly propagate error