Fix bug when generate .h and .cpp files.