prefix table name on some scopes

Fixes #4226