Some changes to sample filtering