Fix munging of database names

Note this pull request is munging a couple of the special character `tr` statements, due to GitHub editor's mangling of them.