Fix timestamp handling