Fixed compiler errors in sample code