Ensure an after clause is generated only if required