Fix non-string 'type' bug

Fixes #1