Fixes 'division by zero' notice when calculating the 'per_row' logic.