Stop PaintingSwitch keeping strings as weak references.