Changes to DB code. Fix