Fix some Python 3.x code errors according to issue #145

Fix for Issue #Python 3.2.2 syntax error. It's not fix for issues #16 yet and code works on python 2.x