Added missing GROUP BY for fetching all tags, fixes #817