anchor.diff:                      cdet%f = walker_dets(:,pos)
                       cluster_population = walker_population(1,pos)
                   else
  -                    call collapse_cluster(walker_dets(:,pos), walker_population(1,pos), cdet%f, cluster_population)
  +                    call collapse_cluster(walker_dets(:,pos), walker_population(1,pos), cdet%f, cluster_population, allowed)
  +                    if (.not.allowed) exit
                   end if
  -                if (cluster_population == 0) exit
                   if (walker_population(1,pos) <= initiator_population) cdet%initiator_flag = 1
                   ! Probability of choosing this excitor = pop/tot_pop.
                   cluster%pselect = (cluster%pselect*abs(walker_population(1,pos)))/tot_excip_pop
                   cluster%excitors(i)%f => walker_dets(:,pos)
               end do
   
  -            ! We chose excitors with a probability proportional to their
  -            ! occupation.  However, because (for example) the cluster t_X t_Y
  -            ! and t_Y t_X collapse onto the same excitor (where X and Y each
  -            ! label an excitor), the probability of selecting a given cluster is
  -            ! proportional to the number of ways the cluster could have been
  -            ! formed.  (One can view this factorial contribution as the
  -            ! factorial prefactors in the series expansion of e^T---see Eq (8)
  -            ! in the module-level comments.)
  -            cluster%pselect = cluster%pselect*factorial(cluster%nexcitors)
  -
  -            if (cluster_population /= 0) cluster%excitation_level = get_excitation_level(f0, cdet%f)
  +            if (allowed) cluster%excitation_level = get_excitation_level(f0, cdet%f)
               ! To contribute the cluster must be within a double excitation of
               ! the maximum excitation included in the CC wavefunction.
  -            if (cluster%excitation_level > truncation_level+2) cluster_population = 0
  -
  -            if (cluster_population /= 0) then
  +            if (cluster%excitation_level > truncation_level+2) allowed = .false.
  +
  +            if (allowed) then
  +                ! We chose excitors with a probability proportional to their
  +                ! occupation.  However, because (for example) the cluster t_X t_Y
  +                ! and t_Y t_X collapse onto the same excitor (where X and Y each
  +                ! label an excitor), the probability of selecting a given cluster is
  +                ! proportional to the number of ways the cluster could have been
  +                ! formed.  (One can view this factorial contribution as the
  +                ! factorial prefactors in the series expansion of e^T---see Eq (8)
  +                ! in the module-level comments.)
  +                cluster%pselect = cluster%pselect*factorial(cluster%nexcitors)
  +
                   ! Sign change due to difference between determinant
                   ! representation and excitors and excitation level.
                   call convert_excitor_to_determinant(cdet%f, cluster%excitation_level, cluster%cluster_to_det_sign)
   
                   ! Normalisation factor for cluster%amplitudes...
  -                cluster%amplitude = real(cluster_population,p)/(D0_normalisation**(cluster%nexcitors-1))
  -                ! Factorial due to the series expansion of exp(\hat{T}).
  -                cluster%amplitude = cluster%amplitude!/factorial(cluster%nexcitors)
  +                cluster%amplitude = cluster_population/(D0_normalisation**(cluster%nexcitors-1))
               else
                   ! Simply set excitation level to a too high (fake) level to avoid
                   ! this cluster being used.
  
positive.code:         type(det_info), intent(inout) :: cdet
          type(cluster_t), intent(inout) :: cluster
  
          real(p) :: rand, psize
          integer :: i, pos, pop, cluster_population, excitor_sgn
          logical :: hit
  
          ! We shall accumulate the factors which comprise cluster%pselect as we go.
          !   cluster%pselect = n_sel p_size p_clust
  
negative.code:         integer(i0), intent(in) :: excitor(basis_length)
          integer, intent(in) :: excitor_population
          integer(i0), intent(inout) :: cluster_excitor(basis_length)
          real(p), intent(inout) :: cluster_population
          logical,  intent(out) :: allowed
  
          integer :: ibasis, ibit
          integer(i0) :: excitor_excitation(basis_length), excitor_annihilation(basis_length), excitor_creation(basis_length)
  