I believe the attached patch fixes issue 879. Don't think it's a big deal,
but it was flagged as a frog task so I thought I'd contribute. I have run
my own regtest checker against the regtests and there were no differences.
Please could someone with git access check and push if it's OK.