Fixed bug with lingering audio channels. Improved test cases. Small optimizations.