fix perms on broken links, better err handling