Fix broken COM memory management.