minor build fixes; major induction of CHI code