Moved new code from SVN.