The JSONTomIRC.mrc script contains the ON EXIT event. I disabled it and it stopped giving the error, but then I turned it on and it didn't give any more errors even when it was turned on. Of all my scripts, this was the only one that had the event.
Very strange...
Anyway, I started using the /saveini command.