Minor changes in the handling of errors