Add in some handling for errors.