Fix issue when checking for symlinks