Fixed potential callback crashes.
Fixed _onReady code.