Fixed fatal error & a bug with the error handler.