Fix treatment of missing values