Fix sample code based on feedback.