Fixed db storage sql creation bugs.