Fix bugs in snippets & fix typo