Replace calls to error with more descriptive messages