Detecting and removing missing values