Improve ability of halfEscapeMatch() to fix potential negation and alternation errors

In response to #31.