Email bookkeeper fixes

fixes http://manage.dimagi.com/default.asp?106683#603238