Fix non-string 'type' bug