Fix datetime parsing and add some more logging