Fix io according to Slava's review