mkhexgrid: fix inreplace