[[ Bug 13026 ]] Port bugfix to 7.0 branch
Merge pull request #980 from runrevali/bugfix-13026-7_0

[[ Bug 13026 ]] Port bugfix to 7.0 branch
Revert "Merge pull request #980 from runrevali/bugfix-13026-7_0"

This reverts commit e461c13220d0e9a89fe3bd1b93af3fa90203e821, reversing
changes made to ad95dea2b365b527f477e634bbf3f7a259ea9567.
Fix some more building hiccups