Fixing python3 compatibility