Bug and DB fixes