Add filters and fix some bugs in Snippets model.