Making sure properties exist on an object is more robust