Fix LTM group by selection

Fixes #499.