Fix clock bugs