Fix bugs in example code.