Fix spell-targeting issue

Fixed an issue causing spell-targeting to continue until all available
characters were targeted. Also made a couple other minor adjustments to
"magic.c".