Error handler fixes