Fix issue with aggregation deintersect  #997

This fixes issue #997