WCS20 trimming fixes

Pull request for master