Handle separate dbs + other misc. fixes to work on production env/data