issue #19045: Fix state and other duplicate check problems.
Merge pull request #331 from jrogelstad/19045

issue #19045: Fix state and other duplicate check problems.