While at it, provide a proper right-trim transforms function.