Fixed bugs and made improvements for demo