Fixed timestamp generation bug