reapply fix for trimfq, fix for github issue #1