Make type substitution strict. This partially fixes the space leak, and seems to improve performance marginally.