Bugfixes and improvements for examples.