anchor.diff:          type(sys_t), intent(in) :: sys
           integer, intent(in) :: a
   
  -        integer :: ims, isym
  +        integer :: imsi, isymi
   
           ! We explicitly reject excitations i->a where a is already
           ! occupied, so the generation probability, pgen, is simple:
           !   pgen = p_single p(i) p(a|i)
           !        = p_single 1/nel 1/nbasis_sym_spin(ms_i, sym_i)
   
  -        ims = (sys%basis%basis_fns(a)%Ms+3)/2
  -        isym = sys%basis%basis_fns(a)%sym
  -        pgen = 1.0_p/(sys%nel*sys%read_in%pg_sym%nbasis_sym_spin(ims,isym))
  +        imsi = (sys%basis%basis_fns(a)%Ms+3)/2
  +        isymi = sys%basis%basis_fns(a)%sym
  +        pgen = 1.0_p/(sys%nel*sys%read_in%pg_sym%nbasis_sym_spin(imsi,isymi))
   
       end function calc_pgen_single_mol_no_renorm
   
  
positive.code:         integer, intent(out) :: a, b
          logical, intent(out) :: allowed_excitation
  
          integer :: ims, isym, ind, shift, na, fac
  
          ! Select a virtual orbital at random.
          ! Ensure spin can be conserved...
  
negative.code:                 !                = Gamma_i^-1 Gamma_op Gamma_a
                  ! Thus we require
                  !   Gamma_a = Gamma_i Gamma_op
                  isyma = sys%read_in%cross_product_sym_ptr(sys%read_in, sys%basis%basis_fns(i)%sym, op_sym)
                  if (symunocc(imsa, isyma) /= 0) then
                      ! Found i.  Now find a...
                          ! It's cheaper to draw additional random numbers than
                          ! decode the full list of unoccupied orbitals,
                          ! especially as the number of basis functions is usually
                          ! much larger than the number of electrons.
                          do
                              ind = int(sys%read_in%pg_sym%nbasis_sym_spin(imsa,isyma)*get_rand_close_open(rng))+1
                              a = sys%read_in%pg_sym%sym_spin_basis_fns(ind,imsa,isyma)
                              if (.not.btest(f(sys%basis%bit_lookup(2,a)), sys%basis%bit_lookup(1,a))) exit
                          end do
                      exit
  