Syntax modernization and cleanups

Thanks to Juneki Hong for bringing to my attention that some of the
examples no longer built.
Bug-fix in planner

The ecrux being updated was erroneously fed into the planner as well,
leading to redundant OPIter in output plans.

While here, try to make some error messages more informative.