Minor fixes in time handling