Clock sync: fix cleanup code