Fixing loss of specialization after clear and resize.