fixes for user_data having keys with None values

http://manage.dimagi.com/default.asp?132271
http://manage.dimagi.com/default.asp?132268