fixed various type issues that were making demos fail
(#304)