fixed #360: safe delete type() and opaque() declarations