update time handling and fix broken tests