Accept full transition functions only

E.g. "onenterstate" and "onafterevent" instead of "onstate" and "onevent".
Add missing local keyword