Model scopes. Test and minor changes to pull request #3