template instantiations go to cpp
fix one isIdentity bug