Revert "Merge pull request #5507 in master"

This reverts commit 29443bdadc884ef747b37143cf95b68d993f4f9c, reversing
changes made to 17779c3c29680be0a4fa401ca355a7e9de24c6c0.