Fixed lingering calls directly to spark api variables