Trim and a sanity check for the row matcher