Some minor changes to sample code