Fix for end-of-tags detecting patterns

Signed-off-by: Vadim A. Misbakh-Soloviov <mva@mva.name>