Fix max_weight method when no data in db