Fix trim() errors