Bastion: ensure tables are properly scoped, fixes #3385.