Revert "Fixes #1320 again" and "Add test for #1320"

This reverts commit 4156353df3a4e142d8d87e38cf363c467cb9deaf.
This reverts commit a4c313184b1cbc86b1ec59235bf02c7729c12a0c.