Added class name to InvalidTransition exception messages.

This PR sent to the maintainers as well.