Fixed python3 incompatibility