Added checks for uid == 0 so we can setup the system context if necessary