Updated from inhouse upstream.