Fixed crash in audio recording code