FIxed minor errors with time calculations