Fixed for Python3 compatibility