Fixed some bugs in the example.