Finish trimLabels() methods.

Will need to add more test cases for more extensive testing.