Fix group combo in staff type editor.

The group combo box accesses the wrong staff templates, as it uses the combo current item index rather than its data.

Also cleaned a potential infinite loop.