Fix setting up database
Work in progress