fix readable forms in the case of a top-level ref-less group

fixes http://manage.dimagi.com/default.asp?124053

first commit fixes, second commit adds regression test
Thanks, good point. That's something I should also get in the habit of.