Avoid readlink for MacOS compatability.