Revert "Merge pull request #1169 from andralex/5924"

This reverts commit 118d9182a908777d9776fc6aa0d704bced0a8a51, reversing
changes made to 75f578228cd1975995551894ca0717eb19fda0f2.