vocabulary_with_prefix() returns unicode, not str
Fixed a pasto in a comment.
Supplied missing import of os.