Fixed maxDuration bug