Copy from http://upp-mirror.googlecode.com/svn/trunk/