Fix bugs in example