Integrate time-setting fixes/improvements from the master branch.