Trim function result properly.