Some cleanup and enable/disable echo canceller accordingly.
Merge changes on both sides. Double free should be fixed as well on this merge.