Update setup script to use common error checking functions.