Some minor fixes of DB handler.