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