fix remove domain membership bugs

http://manage.dimagi.com/default.asp?51184#293208