DG: Fixed issue #2. Typo in GetState() which results in wrong behaviour.