Type fixes in demo code