Trim the list to remove leading/trailing whitespace

Leading whitespace can cause problems while doing the split(/\s+).