Copied from SVN.