Fixed Python3 compatibility