More minor fixes, proper cleanup in examples.