Fix sample code to compile