better assertions on the C side (check for NAs)