fixing some distribution bugs