Draft: Fixed bug in trim tool