This fixes problems with NULs in files being scanned, but costs +800 bytes. The same can be done to sed (TODO).