datetime bug fixes