Fix fields in data

Also added some checks