Fixing more errors in DB code...