Fixes in the scope refactoring

EA-35