Misc fixes to sample code.