fix more type-switching bugs

the right way to do this is to probably have the Mug definition have
a list of static attributes that don't get overridden during `setAttr`
but this is a reasonable short term workaround.

http://manage.dimagi.com/default.asp?99152
Merge pull request #164 from dimagi/cz

fix more type-switching bugs