Bug fix for MySQL - incorrect column for index