Add guard against bad data.