Fixed code issues in examples