More bugs fixed, getstatechanges preliminary working.