fix template groups