Modular API, minor fixes in CHAID