Bug fix for #520 (select of group by column when using index)