Fix layer time calculation.