Many fixes to get rid of old CModel compiler.