sometimes guess_type returns None

fixes http://manage.dimagi.com/default.asp?71535