Fix some indexes and stuff.