A third of Scottish jails are failing to manage the sentences of long-term inmates properly, Scotland's chief inspector of prisons has said.
The criticism was made in a report on Greenock Prison
A report by Dr Andrew McLellan said he had raised serious questions about "sentence management" in at least five prison inspections last year.
"That is a high figure for a matter so fundamental," said Dr McLellan.
"Sentence management" is the term given to how time in jail is managed to help prisoners avoid re-offending.
The criticism came in a follow-up report on conditions at Greenock prison.
Dr McLellan's report found the jail was less overcrowded than in recent months, but still had 298 prisoners in a jail designed for 254.
Acute demands for staffing meant that in one of the prison's halls staff were routinely diverted from sentence management to escort duties.
In December, 73% of risk and needs assessments had been completed on time, but only 49% of action plans had been completed on time.
"It is not good that the management of very long term prisoners at such a crucial stage in their sentences has been so inconsistent," said Dr McLellan.
"A recovery plan is now in place and steps taken to address the backlog."
According to the report, Greenock was not alone in having inconsistent sentence management.
"Weaknesses in sentence management are a persistent feature of inspection reports in different prisons, and a worrying feature," said the report.
"In the inspections of individual prisons undertaken last year, serious questions have been raised about sentence management in at least five."
His report added: "When prisons are very much overcrowded, sentence management is much more difficult to carry out.
"But it is very important, and no less important when a prison is overcrowded.
"It is in the interests of prisoners and in the interest of public safety that sentence management is carried out well."
He said that the safety of both prisoners and the public may be harmed when sentence management is not carried out properly.
Justice Minister Cathy Jamieson said "radical new measures" proposed in the Scottish Executive's criminal justice reforms would improve the management of offenders and tackle re-offending.
The criminal justice plan would lead to a national strategy to improve the management of offenders while the Management of Offenders Bill would put a legal duty on the prison service and councils to work together to reduce re-offending.
"The bill also gives ministers new powers to intervene to ensure that these organisations are committed to tackling re-offending," explained the minister.