Fixed a small bug that caused an undefined error handler to be called.