Enforce scalar container type constraints.

Fixes various tests that relied on them being enforced.