SACRAMENTO — The counselor at Salinas Valley State Prison paid a surprise visit to Nicholas Shearin's cell with good news: He would go home in two days, after a decade behind bars.
She did not mention that he should have been freed eight months earlier.
Shearin was among as many as 33,000 state inmates whose sentences may have been wrong because they were not given all the time off they earned for good behavior and for working in prison.
Records obtained by The Times show that in August, the state sampled some inmate cases and discovered that in more than half -- 354 of 679 -- the offenders were set to remain in prison a combined 104 years too long. Fifty-nine of those prisoners, including Shearin, had already overstayed and were subsequently released after serving a total of 20 years too many, an average of four months each.
Shearin, 38, who is living with his parents in Hawthorne and looking for a job, went to prison for armed robbery. He received less than a third of the good-behavior credit he was due on a second crime, assaulting another inmate.
Shearin said he had told the corrections staff that he was entitled to more time off his sentence.
"I argued that point," he said. "I put in all the paperwork."
But "they did what they wanted to do at the Department of Corrections," said Shearin, who learned from a reporter that he had stayed in prison too long. "They just told me no."
The errors could cost the state $44 million through the end of this fiscal year if not corrected and more than $80 million through mid-2010. But California's overburdened prison agency waited more than two years to change its method of awarding credit for good behavior after three court rulings, one as early as May 2005, found it to be illegal.
Officials were giving some inmates 15% good behavior time instead of the 50% to which they were entitled. The state fixed release dates for only those inmates who requested it, according to a spokesman for the Department of Corrections and Rehabilitation, who said there was no evidence in Shearin's file that he complained.
Aside from the survey in August, the department did not change its methods for all prisoners until last month, when it began reviewing release dates. Officials said that with too little staff, antiquated computers, too many inmates and a web of arcane sentencing formulas, the job was unmanageable.
State Sen. Gloria Romero (D-Los Angeles), who chairs the Senate's public safety committee, said inmates have a fundamental right to a timely release. She criticized the prison agency's "arrogance in the face of the law to simply say that these people's lives don't matter, but they can just lock them away and essentially throw away the key."
Scott Kernan, the corrections department's chief deputy secretary for adult operations, defended the department. "Our staff struggle every day and do a wonderful job in calculating these cases and prioritizing the workload and getting these guys out," he said. "We're doing as much as we possibly can with the existing resources we have."
Five hundred workers, called case records analysts, compute sentences for 417,000 prisoners who enter or are transferred within the state prison system every year. In December, officials in the Service Employees International Union sued the state on behalf of the analysts, who are responsible for calculating the terms of 500 to 600 inmates each and who fear they can be held accountable for late releases.
The union has been warning prison administrators for 15 or 20 years that analysts were seriously understaffed, said Karen DeVoll, 47, an analyst at Sierra Conservation Center, a prison in Jamestown in the Sierra foothills east of Stockton.
From 2000 until 2004, the state paid $468,280 in legal settlements to prisoners who weren't released on time, according to a 2006 report published by Cal State Sacramento.
The cost of housing prisoners who should not be incarcerated is far higher. The state projected that for the 354 inmate cases reviewed in August, it would have saved $2.3 million if all had been released on time. Overall, failing to correct the errors could cost the state more than $110 million more over the next 15 years. But that figure does not include inflation, and union officials say it would be significantly higher.
DeVoll, who earns the maximum of $53,000 a year after two decades in her job, has decades-old computer systems that cannot calculate current sentencing formulas. She and her colleagues do most of their work, called audits, with pen, paper, calculators and file folders jammed with inmates' papers.
Prison administrators keep track of analysts' mistakes while also pressuring them to work quickly, DeVoll said.