Fix template bugs when generating MOF metamodel

Change-Id: I53981cdcb981bc72ecaf407232fa3d56b8ca2043
Reviewed-by: Sandro S. Andrade <sandroandrade@kde.org>