sh: fix ioreadN_rep and iowriteN_rep