Fixed python 2 compatibility