More adjustments to error handling