Fixed incorrect quants when max specified

Out by one error in loop caused one row of records to be ommitted from
the total above the max specified.
EOL conversions