Fixed bugs and added demo