Functions

Enforce some basic invariants on layouts.