Improvements to utils and date utils