Tighten modal error checking

Fixes #261