Adapted to new template instantiation solution. Now compiles also with
CMake