Fixes: #2270 Lots of errors and problems in the sudo plugin