Fix trim() function