Attempt to fix some problems related to use of temporary objects after they've potentially been destructed