Use weak references to types.

+review REVIEW-5313