fixing (?) db-related bugs