Merge changes Ieac47398,I0161f713

* changes:
  fix(realm): fix calculation of Realm's REC index
  fix(realm): fix realm initialisation code