fixing bugs in slots/modules/template relations