Adapt to changed layer API