Fixed cast error in samples.