Fixed database builder

I even tested it.