Revert "Reverse commit 9e7dde6, fixes #1773"

This reverts commit b4902e127393d587488ab84e97530daca257a602.