Fix the reuse of AST nodes for while loops and assigns.

This gives much less confusing error-reporting at the expense of a bunch of
similar code.