Add check for 0 branch array length.