Added unittests for MinimumScoreFilter, fixed several bugs discovered using the tests