Fix bug in CheckWorkHours function