Fixed some bugs and updated demo