Changed destructors to virtual.