shared scope bugfixes.