Fix bugs with snippets