Fixing context issues for db and app namespaces.