Revert "Merge pull request #2505 from andymckay/revert"

This reverts commit 023094f3363e360fe5399ee1e667bb1a0a35e8c1, reversing
changes made to 4ef41eb1b7781179eca7805215cea97df7080243.