Fixed copy'n'paste error in the state flushing routine.
Reported by Stéphane Alnet (shimaore)
Closing issue #154