Fix some bugs; sample network