Fix two minor bugs in Realm construction.