Manually merging in #1926