fixed some issues with __scope_link