NEW YORK (AP) — Harvey Weinstein violated his bail conditions by mishandling his electronic ankle monitor, which left his whereabouts unrecorded for hours at a time, a New York prosecutor argued Friday.

Prosecutor Joan Illuzzi spoke at a pretrial hearing for Weinstein, who is free on $1 million bail. Prosecutors accuse him of leaving home a piece of the monitoring technology that keeps the ankle bracelet activated.

Here is #HarveyWeinstein hobbling out of the courthouse with his defense. He walked in with a cane, but didn’t use the crutch on the way out. pic.twitter.com/HyJNYPFtLn — Elizabeth Wagmeister (@EWagmeister) December 6, 2019

Defense attorney Donna Rotunno denied it was deliberate. She blamed “technical glitches” like dead batteries. Weinstein has pleaded not guilty to charges of rape and sexual assault.

“It has nothing to do with any manipulation of the bracelet,” Rotunno told reporters after leaving court. She acknowledged that on at least one occasion, he’d forgotten part of the device when he left the house. “The minute he realized he forgot it, he made a phone call.”

A judge deferred any decision about whether Weinstein would face any penalty over the alleged violations until next week.

The Oscar-winning producer was in court for one of many proceedings that courts across the state are scheduling to apprise defendants of reforms to New York’s bail system that are set to take effect Jan. 1.

State lawmakers passed a law this year eliminating cash bail for most nonviolent crimes. For poorer defendants facing lesser charges, these appearances could mean release from jail come the new year — or refunds for those who have posted bail.

Those outcomes are unlikely to happen in Weinstein’s case, which is scheduled to go to trial in January.

Weinstein, 67, has pleaded not guilty to charges he raped a woman in a Manhattan hotel room in 2013 and performed a forcible sex act on a different woman in 2006. He is free on $1 million bail and maintains that any sexual activity was consensual.

Weinstein’s deep pockets have given him plenty of freedom as he awaits trial on the charges, which could put him in jail for the rest of his life.

Out on bail since his arrest last year, the disgraced movie mogul has been spotted hobnobbing at New York City nightclubs and getting jeered at a recent actors showcase.

But poorer defendants who have been hauled into courthouses for lesser offenses have ended up in jail if they can’t afford a bail of even a few hundred dollars.

That financial and fairness divide was one New York lawmakers were aiming to solve with sweeping bail reforms.

Among the changes: The bail law signed by Gov. Andrew Cuomo in April eliminates pretrial detention and money bail for the wide majority of misdemeanor and nonviolent felony cases. It also mandates that police issue court appearance tickets instead of arresting people for low-level offenses.

The reforms were motivated in part by the case of Kalief Browder, who was denied bail after he was arrested at age 16 on a charge that he stole a bag, and then spent three years in custody before the case was dropped without a trial. He later killed himself.

People charged with rape and other serious sexual offenses can still be ordered to post bail or be put into pretrial detention come the new year.

Part of the new law bars the court system from requiring defendants to paying fees to maintain electronic monitoring systems. That could mean that Weinstein, who has been paying his own monitoring costs, will have to stop doing so.

The rollout of the bail law has varied across the state, with some areas having robust coordination while others are doing little to nothing at all, said Insha Rahman, director of strategy and new initiatives at the Vera Institute of Justice.

Kevin Stadelmaier, chief attorney of the criminal defense unit at the Legal Aid Bureau of Buffalo, said his defense lawyers have been preparing for months and are seeking to free people charged with low-level offenses before the law takes effect.

“We’re really going to see the fruits of our labor come Jan. 1,” he said.

In Rochester, Timothy Donaher, the county public defender, said the Monroe County sheriff’s office reached out months ago to say they’ve identified inmates who should be freed under the new law.

In New York City, preparation has included discussions between prosecutors, defense attorneys and nonprofit pretrial service providers. Other counties are taking a “wait and see” approach, Rahman said, where judges will wait to receive legal challenges in the new year before releasing someone allowed to be held in jail under the old bail rules.

David Hoovler, district attorney in Orange County, criticized the monthslong rollout, saying there should have been more time given to prepare for such sweeping changes.

“There’s very little guidance by anyone,” he said.