Merge functions from upstream.