Fixed db script errors