Fixed code issues in example code