fix bugs in examples