Further fixes in DatabaseProvider