Fix errors in the sample code