Fixed dumping state. Some stylistic changes.