Fixed compatiblity issues with Python 3.3