Fixed a host of StateView problems.