bug fixes on scope testing