Fixed the error handlers