Added a bit more logging and an assert that kicks in when objectForClass does not find an object.