add Master, ClockService UT and minor bug fix