Fixes issue with removing objects from scene that don't have materials (...

...e.g. cameras).