Fixed bugs with checking for root privelages