add tests for flac and fix bug