Corrected checks for NaN in metadata extractor