Changes to make the scope selector and exclusion function propperly.