Fix datetime usage, indexing.