Fixed crash in error handler.