Various bug fixes around the demo