Thousands of state workers could reap the benefits of a new payroll system that's finding many errors that the old one apparently made for years.

According to a story first reported by Bryan Sears of  The Daily Record, up to 13,000 state workers are in line to receive back pay of anywhere from $2 per paycheck to $30.

The question is how far back in time does this problem go? State officials said workers could be owed money dating back decades.

The problem was discovered when the state installed a modern, electronic payroll system this year. The old one, officials said, miscalculated overtime and shift differential pay, in other words, when workers were on a shift that may have paid more than others.

State officials said it appears this affected people in six state agencies, particularly the ones that operate 24/7 like prisons, mental hospitals or state police.

The largest state worker union said the glitch was no surprise to them and that it has been an issue for years.

"We've brought them up. We've pointed out these errors. They've either corrected them or said they don't have a problem, and it turns out our members were right on this and the bureaucrats were wrong," said Patrick Moran, with the AFSCME state worker's union.

The governor's office told WBAL-TV, "Governor Hogan was elected to clean up these kinds of problems, and that is precisely what his administration is doing on this issue."

State officials said it's possible some workers were overpaid, but at this point, it plans to focus first on who deserves back pay and how much.

Statement from Patrick Moran, President of AFSCME, Council 3

“Our members have raised serious disagreements with the State of Maryland for decades about payroll mistakes which unfairly underpay workers at 24-7 facilities such as state hospitals and prisons. 

It turns out that our members were right and the bureaucrats were wrong. We will work aggressively to right this wrong and secure wage fairness for all state employees.”