Calculate arities of methods properly.