fixed bug with samples min and max not being set