Fixed the last of the state change bugs