Minor fixes in tests and examples