Fix sample filtering tool