Add code from upstream.