Allow setting a maximum number of branches.