Bugfixes in process_corpus.rb