added check for data integrity in wavparse; reset file after constructor