Fix recorded audio files being truncated, and some other cleanup...