People's jobs and freedom are being jeopardised by the roll-out of new software by California's courts.
Take the example of Andrew.
It was Saturday and he was woken up with a start by his mother. There were four officers at the front door and he was about to be arrested.
"I’d only had four hours sleep and I’m only wearing gym shorts,” he recalled.
“I’m thinking, what happened? I was completely confused.”
Unbeknown to his parents, 24-year-old Andrew - not his real name - had recently finished a six-month drug programme after he was caught in possession of marijuana and ecstasy.
Which is why he was so confused. It was his first offence and he had done the course as asked. A judge had then told him the case had been dismissed.
“I did what I was supposed to."
But the court’s new computer system had other ideas and Andrew was put into a police car and driven off to jail.
Andrew’s story is just one of many relating to Odyssey, the new system being rolled out across much of California to deal with case file management.
So far, the problems have seen people wrongfully arrested, held in prison longer than required and in several cases mistakenly told they must register as sex offenders.
The software, created by Texas-based Tyler Technologies, costs about $5m (£4m) and is set to gradually replace a decades-old e-filing system that looks like something a hacker would use in a Hollywood movie.
Tyler Technologies acknowledged in a statement that the upgrade process had been “challenging” - but said poor training was to blame for bad inputting of data and integration with third-party applications that often introduce glitches into the system.
One of the state's early adopters of the new technology is Alameda County, an area which covers around 1.5 million people in the San Francisco Bay Area, though not San Francisco itself.
The county’s public defender, Brendon Woods, is now supporting many clients who have been affected by the issues.
He said a cumbersome user interface was causing the time taken to update a record to jump from around one minute to as much as 30 minutes per entry.
As well as wrongful arrests and incorrectly extended custody, Mr Woods has seen several cases of misdemeanour offenses incorrectly appearing on the system as serious felony charges.
He sees the continued use of the software as a threat to the constitutional rights of many people living in the county.
“It’s something that shouldn’t happen,” Mr Woods told the BBC.
“When you could be out in the community, working, providing for your family, seeing your kids… and then one minute you are in jail - due to no fault of your own?
“That is absolutely terrible.”
A missed Thanksgiving
Mr Woods has filed a motion to compel the court to either keep accurate same-day records or completely abandon the new system, which he described as being unfit for purpose.
The initial judge in the case chose not to hear the motion, instead referring it to a more senior judge to be heard in mid-January.
That is too long to wait, Mr Woods argued - and so he has appealed against that decision to Alameda County’s Superior Court.
Until it is resolved, he said his inbox is steadily filling up with incidents in Alameda County and beyond.
“I got an email yesterday,” he says.
“We had a client who took a [plea] deal and he was supposed to be released the day before Thanksgiving. The system wasn’t inputted properly. He was held an extra four days.”
Minor driving offences were incorrectly appearing as serious felonies, meaning if an affected person applied for a job, they are likely to be flagged as having a serious criminal record.
Mr Woods added: “We’ve had clients who were supposed to register as drug offenders, the system shows them as registering as sex offenders.”
Tyler Technologies provided a statement to the BBC in which it defended its software, and shifted blame back to Alameda County’s staff.
It said many factors could impact the software’s usefulness, among them training of those who use the technology.
“We are confident that we have the experience to help our client navigate those inevitable headwinds, just as we have done many times before with other complex implementations,” spokesman Tony Katsulos said.
“However, this must be a co-operative process. A project’s success is contingent on both parties - the jurisdiction and the software provider - working co-operatively together.
“We have reiterated our commitment to this approach to Alameda and continue to make ourselves available to them.”
Alameda County is not the only area to have struggled with Odyssey. Similar problems have been reported in Tennessee and also in Indiana - where prosecutors have had a perhaps more troubling issue of inmates being mistakenly released early.
But Tyler Technologies said the problems only amounted to a handful of issues given the software is used in over 600 counties across 21 US states.
The plea for patience angered Andrew, who said were it not for a supportive family, his life could have spiralled as a result of the wrongful arrest.
He said he expected some people to have less concern about the issue given that those being mistakenly arrested were involved in a crime of some nature.
“If you don’t sympathise with me, I don’t really care at this point. What happened to me was definitely not fair. There’s no justification for that.
“I paid my dues, I’m better for it.
“But that was not right.”