Improve sudo detection