Fix division error in Python 3