Fixed python v3 support for utils.