Cleaning up WAV loader function.