Bulk export fixes

two issues related to http://manage.dimagi.com/default.asp?131207

can review by commit