Cleaned up code in the scope test.