An attempt to fix an unnecessary ZeroDivisionError