Fixed python3 compatibility problem