Small buf fix on trim call