Fixes rake task divide by zero when there are no characters of an affinity