Fixed bug in distribute_products