Fix regression tests and a use after realloc. ok jasper@
the fixincludes machinery. Works on OpenBSD, some regression tests fail because of difference in our shell and sed behavior...