Production Smoothing with Stochastic Demand and Related Inventory Problems