Fix issue when rows is empty.