Initial version ported from SVN.