More reliable [.grouped_df method.
Closes #635