Added class name to InvalidTransition exception messages.

This PR also sent to the maintainers.