Fixes to database scripts

Fixes typos in database scripts to be ready for production.