fix some typos
fix broken name reference (probably after an incomplete refactoring)
fix up demo code
minor code cleanup
minor code cleanup
fix up example code