Fix bug in sample code.