corrected the order of setting metadata/indexing the JSON fragment (metadata should be set before indexing)
fixed indexing of records that are too short to cover all the columns in a multi-column index