HOTFIX for 32 bit problem:
- there where some hardcoded size_t's
  replaced one with SubGm::LabelType
- added a template to avoid errors