Improve error message when attempting to reference invalid path.