Fixes to samples by Lasantha