anchor.diff:          call init_molecular_integrals()
   
           ! read integrals and eigenvalues
  +        ios = 0
           do
               ! loop over lines.
               read (ir,*, iostat=ios) x, i, a, j, b
  -            if (ios < 0) exit ! reached end of file
  -            if (ios > 0) call stop_all('read_input','Problem reading input.')
  +            if (ios == iostat_end) exit ! reached end of file
  +            if (ios /= 0) call stop_all('read_input','Problem reading input.')
               if (.not.uhf) then
                   ! Working in spin-orbitals but FCIDUMP is in spatial orbitals.
  +                ! Need to only store integrals in one spin-channel in RHF, so
  +                ! can just with (e.g.) beta orbitals.
                   i = i*2
                   j = j*2
                   a = a*2
  
positive.code:         use utils, only: get_free_unit
          use checking, only: check_allocate
          use errors, only: stop_all
  
          ! System data
          ! We don't know how many orbitals we have until we read in the FCI
  
negative.code: module read_in_system
  
  ! Module for reading in and manipulating integral files which entirely define
  ! the Hamiltonian corresponding to a 'real' system.
  
  use const
  
  