anchor.diff:  
           ! [todo] - consider setting hmatel%r and hmatel%c to zero to avoid undefined behaviour.
           ! [todo] - although it is probably fine, abs_hmatel_ptr ignores the irrelevant bit.
  +
  +        if (original) then
  +            ! check whether we are allowed to use the original heat bath algorithm. Exit if not.
  +            call check_heat_bath_bias(sys)
  +        end if
   
           j_nonzero = 0
   
  
positive.code:         end do
  
      end subroutine init_excit_mol_heat_bath
  
      subroutine gen_excit_mol_heat_bath(rng, sys, excit_gen_data, cdet, pgen, connection, hmatel, allowed_excitation)
  
  
negative.code:             end do
              hb%i_weights(i) = i_weight
  
              ! Old test for bias. Replaced by subroutine check_heat_bath_bias
              ! Test that all single excitation i -> a that are allowed have some non zero weight ija for some j.
              !do a = 1, sys%basis%nbasis
              !    if ((j_nonzero(a,i) < (sys%basis%nbasis - sys%nel)) .and. (original == .true.) .and. (i /= a)) then
              !        ! no non zero weight ija for some j and (i /= a). Now check that i -> a is valid.
              !        ims = sys%basis%basis_fns(i)%ms
              !        isyma = sys%read_in%cross_product_sym_ptr(sys%read_in, sys%basis%basis_fns(i)%sym, &
              !                                        sys%read_in%pg_sym%gamma_sym)
              !        if ((sys%basis%basis_fns(a)%sym == isyma) .and. (sys%basis%basis_fns(a)%ms == ims)) then
              !            call stop_all('init_excit_mol_heat_bath','Not all possible single excitations can be accounted for. &
              !                Use another excitation generator.')
              !        end if
              !    end if
              !end do
          end do
  
          do i = 1, sys%basis%nbasis
  