USe id instead of tid, wid. Mantain backward compatibility.
fix bug.
deal better when nopos.
Add beginTimestamp and endTimestamp attributes in header