make ctdTrim() work in R 3.0

Possible bug fix for issue 316