Solve a bug in compareClock method