Prepare for Python3 compatibility