Fix function prototype and clean up header in C template