ncm-spma: deal with undef and empty groups

properly handle so called exception handling using return undef (empty set scalar is logical equivalent of false)