Fixed template header and source file problem in a better way. Now
everything works with both make and CMake