Improve permission handling when using self-update