Modified runAsRoot to return exit codes properly