revert to 070bf4cb92553b305b7eebe748350b855bc0d291

Subsequent commits reverted a bugfix for a serious bug that could result
in a bad form.  Some other approach than reintroducing a bug to master
should be taken.
Merge pull request #87 from dimagi/restore

revert to 070bf4cb92553b305b7eebe748350b855bc0d291