BUG: Compare strings for equality, not identity.

Strings in Python are usually interned (https://en.wikipedia.org/wiki/String_interning) but not always, so comparing identity can fail.