Add clock.
Fix datalen calculation.