Add an example(can be use), and fix some bugs.