Fix issue with relative symlinks

Fixes #7711