Fix side effect bug in GMW io