getBaseTypeIdentifier() can return NULL.
Compare the whole string.

We're not looking for __tesla_automaton_description_OTHER_STUFF; just compare the entire string.
Trivial: clarify comments.

Remove a redundant comment and add a new one to separate different kinds of things.