Get indexes built, fix some legend bugs