Clean up magic variable handling.