Fix bug in the demo script