Fix bug of sample code.