Fix issue 12859 again

The direct pushing by Andrew Edwards had accidentally reverted regression fix.
Merge pull request #2286 from 9rnsr/fix12859

Fix issue 12859 again