Fix some bugs in demo