fix some problems with timespec