Import of 1.5 code from May 2007