Small improvements for demo code