Revert "Revert "This is supposed to fix issue #471.""

This reverts commit 1e6605d95b86b949db78ec72b74d5835b1e8f797.