Fixed sample_data a bit, and corresponding test as well