Correct trimming

Carlo FERRIGNO requested to merge correct-trimming into master

@dmaniada can you make a couple of tests for me? It might need trivial corrections.

Merge request reports