Fix logic bug in disable-sudo code; add docs