You're getting a magenta outline because of this:
Add magenta in before indexing and index without transparency checked.
This is extremely bad advice.
Once you've got your CSP set up how you want it, index. Do not add magenta yet. Index with one less color than necessary. Go to the palette. In Photoshop, this is at Image>Mode>View Palette (or whatever, it's the very last option in the list). In GIMP, it's at Windows>Dockable Dialogs>Color Map. Add magenta as the last color. Make a new layer and fill it with magenta, then move it under the layer with the picture. You're done.