Fixed #22 -- Error in group by clause: only includes the primary key