Add unit tests and fix a bug with time-zone offsets during Daylight Saving Time