Fix a couple of issues with RA.group operation

  * skip grouping if attributes are nil
  * fix header to exclude grouped attribute names