fixes race condition
fixes rare issue

Let Q,S be sequences. If Q contains a nucleotide which S doesn't, before this commit the comparision would break at that point (or atleast in some cases). No it'll be treated as regular mismatch.