Fixed db issues. woohoo