Fixes and improvements to as.Date functionality.