Element state handling fixes
Fixes #202 (closed) and additional issues with non-strict mode as described in the commit messages. We need to increase test coverage.
Fixes #202 (closed) and additional issues with non-strict mode as described in the commit messages. We need to increase test coverage.