Added handling of non-string types to avoid exception when trying to enc...

...ode.  Fixes #217.