More changes from varnish 3 and some specific to master