some fixes in the demo code