Fixed scopes. Updated version.