Fix small issues with the sample and code cleanup.