Convert these functions to use ErrorOr.