Fix back from m_totalLength to m_length in envelope