Use a more reliable check for root user. It's not the name but the ID that makes the root.
Exit with error code 1 instead of success code 0 in case of errors