Handle symlinks to files correctly