some improvements to error handling for weighting; truncation of long fields, and handling of fields that are arrays