Add new example. Fixed some bugs.