Fixed bug in snippets, length instead of index end.