Minor updates to error handling