Do not store the relative path unless it can be reliably determined (see #5339)