Partially implement PR #2155