Fix defects from the groups merge.

This addresses some issues from #1760 that Coverity reported.