Fix division error in Python 3 and remove unused method