use AR 4 syntax or prefix table name on some scopes

Fixes #4225