Db connect

More quick fixes found while debugging