More improvements to the state along with a lot more bug fixes