Minor tweaks to sample code to pass the compiler warnings.