Improve return value of getCanonicalPath