Fixed rebuilding the index in SQL mode
A small fix for reindexing environments