Only trim non-nil strings