Fixed bugs where virtual destructors weren't treated as virtual functions for a number of purposes.