Fix template bugs when generating MOF metamodel implementation

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