Dealing with invalid symlinks and symlink permissions