Added a few useful functions for testing and manipulation of states.