Fix an integer overflow bug in local transitivity