                                         (first emptyRows)]
 
                                        :else
-                                       (take 2 emptyRows)))))))))
+                                       (take TIMETABLE-MIN-ROWS-FOR-DAY
+                                             emptyRows)))))))))
 
 (defn- timetable-remove-lesson-group!
   "Removes a selected lesson group for a module from the `Timetable`.

  (doseq [day (range 5)]
    (let [nrRows   (timetable-day-get-nr-rows day)
          $dayElem (nth HTML-Timetable day)]
      ; Remove rows >= 2
      (doseq [rowIdx (reverse (range 2 nrRows))]
        (.remove (nth (children $dayElem "tr") rowIdx)))
      ; Remove all <td>
      (.remove (.find $dayElem "td"))
      ; Add clean <td>
      (doseq [rowIdx (range 2)]
        (.append (nth (children $dayElem "tr") rowIdx)
                 ($ Timetable-Row-TD-HTML-String)))
      (attr (.find $dayElem "tr > th") "rowspan" 2))))

(defn- add-module-lesson!
  "Adds a single lesson of a module the timetable.

(defn- create-day-repr
  "Creates in-memory representation of a single day in the timetable.

   Each day is a vector of rows, and there is a minimum of
   `TIMETABLE-MIN-ROWS-FOR-DAY` rows in each day.
   Multiple rows are needed when there are lessons with overlapping start and
   end time."
  []
  (loop [ttDay           []
         nrRowsRemaining TIMETABLE-MIN-ROWS-FOR-DAY]
    (if (zero? nrRowsRemaining)
        ttDay
        (recur (conj ttDay (create-empty-timetable-row))
               (dec nrRowsRemaining)))))

(defn timetable-create!
  "Initializes the in-memory representation of the timetable.
