Fix compile error of sample code