fix bugs in code examples