Fix some bugs in calculating the total number of input dependent branches.