Db test and fix

Database works now!!! (hopefully)