Fix apitools exception when resetting debuglevels