Fix issue #200

This pull request fixes #200.
Also some more python enhancements.

The issue was tested on base of reproducer.