A care home where a man with Alzheimer's died after eating chlorine tablets has been fined £270,000.
James McConnell was a resident at Lomond Court in Glenrothes when he died in August 2015, a week after eating the disinfectant tablets.
The 72-year-old had found and opened a package which he thought contained strong mints.
The Health and Safety Executive said the company failed to assess the risk posed by several chemical products.
An HSE investigation also found the care home's operators HC-ONE Limited failed to manage and review procedures for the delivery of the products for two years.
Darlington-based HC-ONE pleaded guilty at Kirkcaldy Sheriff Court to breaching the Health and Safety at Work Act 1974.
A spokeswoman for the company said they "wholeheartedly" apologised to the McConnell family.
Speaking after the hearing, HSE inspector Garry Miller said the case confirmed the need for staff to be "extra vigilant" in ensuring that vulnerable people did not come into contact with harmful substances.
He added: "Suitable procedures need to be put in place and then regularly checked to ensure that they are being followed by everyone, not just for the use of such substances, but also for their delivery, storage and disposal."
A spokeswoman for HC-ONE said they hoped that the court ruling provided "some sense of closure" for the McConnell family.
The company's chief operating officer Paula Keys said: "We have always been clear that lessons must be learned from this tragic event, as the health and safety of our residents is our absolute priority.
"When it happened in August 2015, we immediately issued new delivery guidance to our colleagues and suppliers so that potentially harmful products are securely stored on arrival at our homes, as well as insisting on 'tamper proof' containers for any potentially harmful products.
"A comprehensive internal review was also completed and acted on, and the HSE has approved our new system for handling potentially harmful products."
Mr McConnell's widow Wilma previously told BBC Scotland how she still had "flashbacks" to when her husband was in hospital after eating the tablets.
She said: "I was shocked when I saw him.
"He was a terrible colour and he couldn't eat the porridge I tried to give him as his mouth had started to ulcerate.
"His lips and tongue had turned brown."
Mrs McConnell said the care home had told her a delivery driver, who knew the security code for the main door, had left a package in the hall.
Her husband, who was diagnosed with Alzheimer's in 2012, found and opened the package and ate two of the tablets thinking they were mints.
Later he said to his wife: "I'm sorry, I didn't think I had done anything wrong."