Updated for Realm 0.87