Shouldn't this be fields_len / 4 ?