Fix some bugs, add some samples