[DB] Some misc fixes