Fix some errors in sample code