fix parent refs in advanced module

http://manage.dimagi.com/default.asp?140670