private function fix_row(array &$params, $row) {
        if ($row <= 1) {
            // Row 1 is always present.
            return 1;
        } else if (isset($params['theme_advanced_buttons' . $row])) {
            return $row;
        } else {
            return $this->count_button_rows($params);
        }
    }