Fixed compatibility issues with python 3.3