Fix  issue #40: SIGSEGV on unchecked itterator actions

Fix  SIGSEGV on unchecked itterator actions.
Add tests.