diff --git a/modules/conop/src/rule_based_builder.cc b/modules/conop/src/rule_based_builder.cc
index 2a0a50010c278a878b9d4201152fbab517516bd5..57c8f515407f89bbcebd8255075b919de2695e6f 100644
--- a/modules/conop/src/rule_based_builder.cc
+++ b/modules/conop/src/rule_based_builder.cc
@@ -89,9 +89,10 @@ mol::AtomHandleList RuleBasedBuilder::GetUnknownAtoms(mol::ResidueHandle res)
   if (!last_compound_) {
     return unknown;
   }
+  mol::AtomHandleList atoms=res.GetAtomList();
+  last_residue_=mol::ResidueHandle();
   this->ReorderAtoms(res, last_compound_);
   AtomSpecList::const_iterator j=last_compound_->GetAtomSpecs().begin();
-  mol::AtomHandleList atoms=res.GetAtomList();
   mol::AtomHandleList::iterator i=atoms.begin();
   for (mol::AtomHandleList::iterator 
        i=atoms.begin(), e=atoms.end(); i!=e; ++i) {
@@ -153,6 +154,7 @@ void RuleBasedBuilder::ReorderAtoms(mol::ResidueHandle residue,
   mol::impl::AtomImplList::iterator i=impl->GetAtomList().begin();
   for (; i!=impl->GetAtomList().end(); ++i) {
     mol::impl::AtomImplPtr atom=*i;
+    atom->SetState(std::numeric_limits<unsigned int>::max());
     int index=compound->GetAtomSpecIndex(atom->GetName());
     if (index==-1) {
       if (!this->OnUnknownAtom(mol::AtomHandle(atom))) {
diff --git a/modules/conop/src/rule_based_builder.hh b/modules/conop/src/rule_based_builder.hh
index 9adcc67479a6e7282721051c246217e4abec38bd..9ecc45c101cbbb2c6777ff7fb985bb2e9e921db1 100644
--- a/modules/conop/src/rule_based_builder.hh
+++ b/modules/conop/src/rule_based_builder.hh
@@ -116,9 +116,6 @@ public:
   /// \brief Set residue properties such as chemical class
   virtual void FillResidueProps(mol::ResidueHandle residue);
 
-  /// \brief whether the residue has unknown atoms
-  bool HasUnknownAtoms(mol::ResidueHandle res);
-  
   mol::AtomHandleList GetUnknownAtoms(mol::ResidueHandle res);
   
   /// \brief Check whether the residue has all required atoms. This does not
@@ -131,6 +128,9 @@ private:
   CompoundPtr         last_compound_;
   mol::ResidueHandle  last_residue_;
   bool                unknown_atoms_;
+  /// \brief whether the residue has unknown atoms
+  bool HasUnknownAtoms(mol::ResidueHandle res);
+
   void LookupCompound(const mol::ResidueHandle& rh);
   /// Change internal order of atoms in residue to the order given by compound
   void ReorderAtoms(mol::ResidueHandle residue, CompoundPtr compound);