Imported from http://svn.buddypress.org/tags/1.6.3/