Fixed null pointer when metadata does not contain expected value.