fixed save / load of input/output states, fix #2011