Fix for each_sample