Fixes Bug 914816 - Changes to the GROUP BY rules for device summary, and reordering the columns per KaiRo's request.

@peterbe r?