TimeLine: fix many race conditions, and emit only if necessary