Fix bugs in examples