Fix exception handling
Merge pull request #6 from gryphius/master

Fix exception handling in python demos