ALBANY -- New York narrowly avoided a spooky situation.

The state Comptroller's Office said it blocked 2,052 tax-rebate checks worth nearly $819,000 addressed to dead homeowners from hitting mailboxes.

Overall, the office returned nearly 32,000 rebate checks totaling $8 million to the state Department of Taxation and Finance, avoiding them erroneously going out last year.

The inaccurate rebate checks represented a small portion of the so-called "tax-freeze" checks that went out in 2015: nearly 2.1 million checks totaling $600 million were mailed out.

The Comptroller's Office "approved 99 percent of the 2015 freeze checks without any changes," the tax department wrote in its audit response.

"For the remaining checks, the department moved quickly to correct any data errors."

"The Tax Department always works directly with local assessors to ensure tax data is submitted accurately and on-time," he said.

The audit illustrated the complexity of the program, which state lawmakers and Gov. Andrew Cuomo approved in 2014.

The tax department needed to figure out payments from 3,775 taxing jurisdictions, and there isn't much uniformity in the reporting from across the state.

New York over the past three years have received rebate checks for the growth in their property taxes if their municipalities and schools stayed under the property-tax cap and developed efficiency plans.

The first year, the check was for the growth in school taxes; the second year it was for school and municipal taxes.

This year, the check that started hitting households in October is a rebate for the growth in municipal taxes, as well as money for a new tax-relief program: $185 for upstate residents and $130 downstate.

The checks should all be out by year's end, the tax department said.

The checks are only available to homeowners whose taxable household income is less than $500,000.

Determining each homeowner's rebate requires coordination between local assessors' office, the tax department and the Comptroller's Office -- which does a random check to make sure the appropriate amounts are going out.

For the latest audit, the Comptroller's Office reviewed nearly 140,000 payments totaling $76 million.

Most of the problems were due to calculation errors, the audit found, totaling nearly $6 million of what was ultimately blocked.

There were another $2.5 million in checks that were also found to have improper formatting that was corrected.

The tax department has faced problems with other tax programs, and there have been ongoing complaints about checks being slow to arrive.

In September, the department acknowledged that some people received wrong STAR rebate checks -- another school-tax-rebate program that was recently converted from an upfront savings to a check for new homeowners.