fixed some bugs in examples