fixed bug with envelopes and Clock.maxMeasures