Backport changes for v1.7.1