Fixed the case of a final root node, and added the include guards in the generated header