Python3 compatibility fix