Fix rare lesson placement bug

Bug occured when two night lessons starting at :00 and :30 clashed, TD after end didn't exist and (duration - 1) happened to be equal to number of TDs till end of row.