Small changes to get adcategory working. Still in progress