Fixed db schema issues