Example type-related fixes

This PR fixes a few type errors picked up by the compiler in the examples.