Fixing problems with time array