Fixes wrong and duplicate indexes. Fixes usage of correct charset.