Fixing syntax errors in sample code