Fixed the magic wand tool and cleaned up a few things