Database fixes

fixed issues with initial database creation