Thank you for the reply.

I will try the first code block and report any change.

The line 954 error came up during a refund. Previously, a similar error that referenced line 354 came after a sale. I will try making the change there also.

I note that the same code also appears on lines 1017 and 1079 approx. I have not encountered errors relating to those lines so I will leave them alone for now.