Towards Python3 compatibility