correct some python snippets