Fix working time calculation bug