Fix error when resolving symlinks