Bugfixes and improvements for examples.
Merge pull request #622 from nawroth/examples

Bugfixes and improvements for examples.