Fixed the not ready exception on Firefox and calling the onReady callback only when really available