anchor.diff:              type(hash_table_t), intent(inout) :: ht
               integer, intent(out) :: indx, err_code
   
  -            indx = ht%free_entries(ht%next_free_entry)
  -            ht%free_entries(ht%next_free_entry) = 0
  -            ht%next_free_entry = modulo(ht%next_free_entry-1,ht%max_free_reqd)
               err_code = 0
  +            indx = 0
  +            if (ht%max_free_reqd > 0) then
  +                indx = ht%free_entries(ht%next_free_entry)
  +                ht%free_entries(ht%next_free_entry) = 0
  +                ht%next_free_entry = modulo(ht%next_free_entry-1,ht%max_free_reqd)
  +            end if
   
               if (indx == 0) then
                   ! Have run out of free slots that we know about in the
  
positive.code:             ! value (i.e. search over hash collisions).
              do i = 1, ht%table(0,pos%islot)
                  pos%indx = ht%table(i,pos%islot)
                  if (all(ht%data_label(:,pos%indx) == label)) then
                      pos%ientry = i
                      hit = .true.
                      exit
  
negative.code:             ht%max_free_reqd = max_free_reqd
              ht%seed = seed
  
              allocate(ht%table(0:ht%nentries,ht%nslots), stat=ierr)
              call check_allocate('ht%table', size(ht%table), ierr)
              if (present(data_label)) then
                  ht%data_label => data_label
  