Trade uncertainty and specialization. Social versus private planning