issue #19550: Fix unit cost calcuation. Fix default date
issue #19550: More fixes and refinements to date handling.