Improve scanning speed by matching certain strings only at fixed offsets
Fix bugs in previous commit