Validate idioms

A rebased version of #124 .