Fixed sudo regression. Fixes #39 and fixes #38