Fix float division problem for py3