Fixed some bugs with setFormat that were causing the wrong dates to
appear.