As per pull request #2237

Hope it is correct.