fixed compilation with python3 bindings
small fixes in examples for python3 compatibility
Merge pull request #1048 from gsomix/feature/python3_bugfix

Pack of fixes for python3 modular interface