Modified code so that it works with both zc.buildout 1.x and 2.x.