Fixed famous callback-related problem that caused onLoad to be called twice under error condition.