Fixed a crash bug and made reading of WAV files endianness-independent.