fix segfaulting and fix time value in case of not supporting filetime