Adding Niall's fix for LANG-59 - an edge case in date truncation - and his enhancement for the unit test that was there.