Minor improvements to sample