Technically, there shouldn't be any empty groups. There were a number of cases before where that could happen anyway, including this one.

It'd probably be worth adding a query to delete any empty groups after an operation like this.