Fix the underlying problem described in #1821, then revert the change done as an intermediate solution.