Snippet fixes

This fixes the snippet creation process for snippets at the end of the content, previously two matches at the end of the content had the effect that the whole content was returned as snippet. Furthermore the matching now continues directly after the previous match and not at the previous position + the context length after the snippet which lead to problems when the match was at the end of the content (no context after the snippet, thus matching the same snippet again).