Merged with upstream changes