Fixed a problem where a state change would throw an exception if there a...

...re no callbacks registered on a class.