Revert "Additional fixes for #3396"

This reverts commit 79f82b346711659bc4189b58a0b5b901a7364a95.