Some fixes for editreg.c, although I see that head seems broken ...