Fixed python3 compatibility
Merge branch 'python3-compatibility'