Initial commit from upstream 1.7.0