More changes to error handling