Revert "Merge pull request #1376 from StevenPuttemans:bugfix_3186"

This reverts commit 41b8479d039bb0ecc36627ae50349b6fcd5e16e3, reversing
changes made to 531471b0aa4b4e8f9fcab8282d5cbe895b77e6e0.

Reason: breaks the build.