Small changes to make the example run without warnings or errors.

Hi,
See commit messages for changes. Only my second time using pull requests, so please let me know if I could/should do anything in a better way.