Fixed demo

Now the demo works. It still has lots of things to improve, this PR just makes it work.