Fixed bug in draw_sample.