Fixed invalid NULL poiter check when registering callbacks.
Fixed compiler warning.