Fixed bug with two error callback calls.