Problem with Agent from IBM/Lotus Support website

I’m running an agent that I found on the IBM/Lotus support site to correct a user’s issue:

http://www.ibm.com/support/docview.wss?rs=475&context=SSKTWP&dc=DB520&dc=DB560&uid=swg21258435&loc=en_US&cs=UTF-8&lang=en&rss=ct475lotus

When I run it, I’m getting the following error message:

“Maximum number of memory segments that Notes can support has been exceeded.”

It doesn’t look like the LS agent is finishing. I’ve been looking at this and looking at this and getting nowhere. Does anyone know of a way to code this agent so that it runs efficiently? I’m running it from a 6.5.4 client.